package com.xb.loan.util.strategy;
/**
 * 
 * 用户表索引分配器
 */
public class DefaultTableNoAllocator implements TableNoAllocator {
    
    private String  col_user_id="user_id";
    private String  tb_prefix="10";

    @Override
    public String getTableNo(String userId) {
        return getTablenNo(userId,col_user_id);
    }

    @Override
    public String getTablenNo(String columnValue, String columnName) {
        if (columnValue == null || "".equals(columnValue))
            throw new RuntimeException(" columnValue is null or empty");
        if (col_user_id.equals(columnName)) {
            return tb_prefix+ columnValue.substring(columnValue.length() - 1);
        }
        return null;
    }

}
